// To parse this JSON data, do
//
//     final groupDynamicModel = groupDynamicModelFromJson(jsonString);

import 'dart:convert';
import 'dart:ui' as ui;

GroupDynamicModel groupDynamicModelFromJson(String str) =>
    GroupDynamicModel.fromJson(json.decode(str));

String groupDynamicModelToJson(GroupDynamicModel data) =>
    json.encode(data.toJson());

class GroupDynamicModel {
  Single? single;
  Unit? unit;

  GroupDynamicModel({this.single, this.unit});

  factory GroupDynamicModel.fromJson(Map<String, dynamic> json) =>
      GroupDynamicModel(
        single: json["single"] == null ? null : Single.fromJson(json["single"]),
        unit:
            (json["unit"] == null || json["unit"] is String)
                ? null
                : Unit.fromJson(json["unit"]),
      );

  Map<String, dynamic> toJson() => {
    "single": single?.toJson(),
    "unit": unit?.toJson(),
  };
}

class Single {
  SingleAttrs? attrs;
  String? className;
  List<SingleChild>? children;

  Single({this.attrs, this.className, this.children});

  factory Single.fromJson(Map<String, dynamic> json) => Single(
    attrs: json["attrs"] == null ? null : SingleAttrs.fromJson(json["attrs"]),
    className: json["className"],
    children:
        json["children"] == null
            ? []
            : List<SingleChild>.from(
              json["children"]!.map((x) => SingleChild.fromJson(x)),
            ),
  );

  Map<String, dynamic> toJson() => {
    "attrs": attrs?.toJson(),
    "className": className,
    "children":
        children == null
            ? []
            : List<dynamic>.from(children!.map((x) => x.toJson())),
  };
}

class SingleAttrs {
  String? backgroundColor;
  int? width;
  int? height;
  bool? draggable;
  double? scaleX;
  double? scaleY;
  double? x;
  double? y;

  SingleAttrs({
    this.backgroundColor,
    this.width,
    this.height,
    this.draggable,
    this.scaleX,
    this.scaleY,
    this.x,
    this.y,
  });

  factory SingleAttrs.fromJson(Map<String, dynamic> json) => SingleAttrs(
    backgroundColor: json["backgroundColor"],
    width: json["width"],
    height: json["height"],
    draggable: json["draggable"],
    scaleX: json["scaleX"]?.toDouble(),
    scaleY: json["scaleY"]?.toDouble(),
    x: json["x"]?.toDouble(),
    y: json["y"]?.toDouble(),
  );

  Map<String, dynamic> toJson() => {
    "backgroundColor": backgroundColor,
    "width": width,
    "height": height,
    "draggable": draggable,
    "scaleX": scaleX,
    "scaleY": scaleY,
    "x": x,
    "y": y,
  };
}

class SingleChild {
  PurpleAttrs? attrs;
  String? className;
  List<PurpleChild>? children;

  SingleChild({this.attrs, this.className, this.children});

  factory SingleChild.fromJson(Map<String, dynamic> json) => SingleChild(
    attrs: json["attrs"] == null ? null : PurpleAttrs.fromJson(json["attrs"]),
    className: json["className"],
    children:
        json["children"] == null
            ? []
            : List<PurpleChild>.from(
              json["children"]!.map((x) => PurpleChild.fromJson(x)),
            ),
  );

  Map<String, dynamic> toJson() => {
    "attrs": attrs?.toJson(),
    "className": className,
    "children":
        children == null
            ? []
            : List<dynamic>.from(children!.map((x) => x.toJson())),
  };
}

class PurpleAttrs {
  PurpleAttrs();

  factory PurpleAttrs.fromJson(Map<String, dynamic> json) => PurpleAttrs();

  Map<String, dynamic> toJson() => {};
}

class PurpleChild {
  FluffyAttrs? attrs;
  String? className;
  List<FluffyChild>? children;

  // 待绘制
  ui.Image? image;

  PurpleChild({this.attrs, this.className, this.children, this.image});

  factory PurpleChild.fromJson(Map<String, dynamic> json) => PurpleChild(
    attrs: json["attrs"] == null ? null : FluffyAttrs.fromJson(json["attrs"]),
    className: json["className"],
    children:
        json["children"] == null
            ? []
            : List<FluffyChild>.from(
              json["children"]!.map((x) => FluffyChild.fromJson(x)),
            ),
  );

  Map<String, dynamic> toJson() => {
    "attrs": attrs?.toJson(),
    "className": className,
    "children":
        children == null
            ? []
            : List<dynamic>.from(children!.map((x) => x.toJson())),
  };
}

class FluffyAttrs {
  Rule? rule;
  String? name;
  String? url;
  bool? draggable;
  double? x;
  double? y;
  double? scaleX;
  double? scaleY;
  Device? device;
  String? text;
  int? fontSize;
  String? fontFamily;
  String? fill;
  PurpleDataPoint? dataPoint;
  List<int>? borderDash;
  String? anchorStroke;
  String? anchorFill;
  int? rotateAnchorOffset;
  List<int>? rotationSnaps;
  int? padding;
  String? borderStroke;
  List<String>? enabledAnchors;
  int? width;
  int? height;

  FluffyAttrs({
    this.rule,
    this.name,
    this.url,
    this.draggable,
    this.x,
    this.y,
    this.scaleX,
    this.scaleY,
    this.device,
    this.text,
    this.fontSize,
    this.fontFamily,
    this.fill,
    this.dataPoint,
    this.borderDash,
    this.anchorStroke,
    this.anchorFill,
    this.rotateAnchorOffset,
    this.rotationSnaps,
    this.padding,
    this.borderStroke,
    this.enabledAnchors,
    this.width,
    this.height,
  });

  factory FluffyAttrs.fromJson(Map<String, dynamic> json) => FluffyAttrs(
    rule: json["rule"] == null ? null : Rule.fromJson(json["rule"]),
    name: json["name"],
    width: json["width"],
    height: json["height"],
    url: json["url"],
    draggable: json["draggable"],
    x: json["x"]?.toDouble(),
    y: json["y"]?.toDouble(),
    scaleX: json["scaleX"]?.toDouble(),
    scaleY: json["scaleY"]?.toDouble(),
    device: json["device"] == null ? null : Device.fromJson(json["device"]),
    text: json["text"],
    fontSize: json["fontSize"],
    fontFamily: json["fontFamily"],
    fill: json["fill"],
    dataPoint:
        json["dataPoint"] == null
            ? null
            : PurpleDataPoint.fromJson(json["dataPoint"]),
    borderDash:
        json["borderDash"] == null
            ? []
            : List<int>.from(json["borderDash"]!.map((x) => x)),
    anchorStroke: json["anchorStroke"],
    anchorFill: json["anchorFill"],
    rotateAnchorOffset: json["rotateAnchorOffset"],
    rotationSnaps:
        json["rotationSnaps"] == null
            ? []
            : List<int>.from(json["rotationSnaps"]!.map((x) => x)),
    padding: json["padding"],
    borderStroke: json["borderStroke"],
    enabledAnchors:
        json["enabledAnchors"] == null
            ? []
            : List<String>.from(json["enabledAnchors"]!.map((x) => x)),
  );

  Map<String, dynamic> toJson() => {
    "rule": rule?.toJson(),
    "name": name,
    "url": url,
    "draggable": draggable,
    "x": x,
    "y": y,
    "scaleX": scaleX,
    "width": width,
    "height": height,
    "scaleY": scaleY,
    "device": device?.toJson(),
    "text": text,
    "fontSize": fontSize,
    "fontFamily": fontFamily,
    "fill": fill,
    "dataPoint": dataPoint?.toJson(),
    "borderDash":
        borderDash == null ? [] : List<dynamic>.from(borderDash!.map((x) => x)),
    "anchorStroke": anchorStroke,
    "anchorFill": anchorFill,
    "rotateAnchorOffset": rotateAnchorOffset,
    "rotationSnaps":
        rotationSnaps == null
            ? []
            : List<dynamic>.from(rotationSnaps!.map((x) => x)),
    "padding": padding,
    "borderStroke": borderStroke,
    "enabledAnchors":
        enabledAnchors == null
            ? []
            : List<dynamic>.from(enabledAnchors!.map((x) => x)),
  };
}

class PurpleDataPoint {
  String? code;
  String? name;
  List<Detail>? details;
  String? unit;
  String? coefficient;
  dynamic valueType;
  String? codecType;
  int? statisticType;
  int? dataLevel;
  int? priority;
  bool? read;
  List<dynamic>? range;
  int? dataWrite;
  dynamic expression;
  String? pointType;
  List<dynamic>? statusMatch;
  dynamic bitRules;
  dynamic valueRules;
  int? startAddress;
  int? registerCnt;
  String? byteOrder;
  bool? show;
  String? en;
  String? zh;
  String? description;
  String? statistics;
  bool? runningStatusFlag;
  int? statusFlag;
  dynamic rules;
  int? sort;
  int? dataLength;
  int? analyticMethod;
  dynamic dataPointLimit;

  PurpleDataPoint({
    this.code,
    this.name,
    this.details,
    this.unit,
    this.coefficient,
    this.valueType,
    this.codecType,
    this.statisticType,
    this.dataLevel,
    this.priority,
    this.read,
    this.range,
    this.dataWrite,
    this.expression,
    this.pointType,
    this.statusMatch,
    this.bitRules,
    this.valueRules,
    this.startAddress,
    this.registerCnt,
    this.byteOrder,
    this.show,
    this.en,
    this.zh,
    this.description,
    this.statistics,
    this.runningStatusFlag,
    this.statusFlag,
    this.rules,
    this.sort,
    this.dataLength,
    this.analyticMethod,
    this.dataPointLimit,
  });

  factory PurpleDataPoint.fromJson(Map<String, dynamic> json) =>
      PurpleDataPoint(
        code: json["code"],
        name: json["name"],
        details:
            json["details"] == null
                ? []
                : List<Detail>.from(
                  json["details"]!.map((x) => Detail.fromJson(x)),
                ),
        unit: json["unit"],
        coefficient: json["coefficient"],
        valueType: json["valueType"],
        codecType: json["codecType"],
        statisticType: json["statisticType"],
        dataLevel: json["dataLevel"],
        priority: json["priority"],
        read: json["read"],
        range:
            json["range"] == null
                ? []
                : List<dynamic>.from(json["range"]!.map((x) => x)),
        dataWrite: json["dataWrite"],
        expression: json["expression"],
        pointType: json["pointType"],
        statusMatch:
            json["statusMatch"] == null
                ? []
                : List<dynamic>.from(json["statusMatch"]!.map((x) => x)),
        bitRules: json["bitRules"],
        valueRules: json["valueRules"],
        startAddress: json["startAddress"],
        registerCnt: json["registerCnt"],
        byteOrder: json["byteOrder"],
        show: json["show"],
        en: json["en"],
        zh: json["zh"],
        description: json["description"],
        statistics: json["statistics"],
        runningStatusFlag: json["runningStatusFlag"],
        statusFlag: json["statusFlag"],
        rules: json["rules"],
        sort: json["sort"],
        dataLength: json["dataLength"],
        analyticMethod: json["analyticMethod"],
        dataPointLimit: json["dataPointLimit"],
      );

  Map<String, dynamic> toJson() => {
    "code": code,
    "name": name,
    "details":
        details == null
            ? []
            : List<dynamic>.from(details!.map((x) => x.toJson())),
    "unit": unit,
    "coefficient": coefficient,
    "valueType": valueType,
    "codecType": codecType,
    "statisticType": statisticType,
    "dataLevel": dataLevel,
    "priority": priority,
    "read": read,
    "range": range == null ? [] : List<dynamic>.from(range!.map((x) => x)),
    "dataWrite": dataWrite,
    "expression": expression,
    "pointType": pointType,
    "statusMatch":
        statusMatch == null
            ? []
            : List<dynamic>.from(statusMatch!.map((x) => x)),
    "bitRules": bitRules,
    "valueRules": valueRules,
    "startAddress": startAddress,
    "registerCnt": registerCnt,
    "byteOrder": byteOrder,
    "show": show,
    "en": en,
    "zh": zh,
    "description": description,
    "statistics": statistics,
    "runningStatusFlag": runningStatusFlag,
    "statusFlag": statusFlag,
    "rules": rules,
    "sort": sort,
    "dataLength": dataLength,
    "analyticMethod": analyticMethod,
    "dataPointLimit": dataPointLimit,
  };
}

class Detail {
  String? name;
  String? locale;

  Detail({this.name, this.locale});

  factory Detail.fromJson(Map<String, dynamic> json) =>
      Detail(name: json["name"], locale: json["locale"]!);

  Map<String, dynamic> toJson() => {"name": name, "locale": locale};
}

class Device {
  int? id;
  String? code;
  String? name;
  String? driver;
  String? protocolCode;

  Device({this.id, this.code, this.name, this.driver, this.protocolCode});

  factory Device.fromJson(Map<String, dynamic> json) => Device(
    id: json["id"],
    code: json["code"],
    name: json["name"],
    driver: json["driver"],
    protocolCode: json["protocolCode"],
  );

  Map<String, dynamic> toJson() => {
    "id": id,
    "code": code,
    "name": name,
    "driver": driver,
    "protocolCode": protocolCode,
  };
}

class Rule {
  String? id;
  String? device;
  String? data;
  String? min;
  String? max;
  String? visible;

  Rule({this.id, this.device, this.data, this.min, this.max, this.visible});

  factory Rule.fromJson(Map<String, dynamic> json) => Rule(
    id: json["id"],
    device: json["device"],
    data: json["data"],
    min: json["min"],
    max: json["max"],
    visible: json["visible"],
  );

  Map<String, dynamic> toJson() => {
    "id": id,
    "device": device,
    "data": data,
    "min": min,
    "max": max,
    "visible": visible,
  };
}

class FluffyChild {
  TentacledAttrs? attrs;
  String? className;
  List<TentacledChild>? children;
  ui.Image? image;

  FluffyChild({this.attrs, this.className, this.children});

  factory FluffyChild.fromJson(Map<String, dynamic> json) => FluffyChild(
    attrs:
        json["attrs"] == null ? null : TentacledAttrs.fromJson(json["attrs"]),
    className: json["className"],
    children:
        json["children"] == null
            ? []
            : List<TentacledChild>.from(
              json["children"]!.map((x) => TentacledChild.fromJson(x)),
            ),
  );

  Map<String, dynamic> toJson() => {
    "attrs": attrs?.toJson(),
    "className": className,
    "children":
        children == null
            ? []
            : List<dynamic>.from(children!.map((x) => x.toJson())),
  };
}

class TentacledAttrs {
  String? name;
  String? fill;
  dynamic cornerRadius;
  int? width;
  int? height;
  bool? draggable;
  int? opacity;
  double? x;
  double? y;
  String? text;
  double? scaleY;
  double? scaleX;
  String? selfDefinedName;
  int? fontSize;

  TentacledAttrs({
    this.name,
    this.fill,
    this.cornerRadius,
    this.width,
    this.height,
    this.draggable,
    this.opacity,
    this.x,
    this.y,
    this.text,
    this.scaleY,
    this.scaleX,
    this.selfDefinedName,
    this.fontSize,
  });

  factory TentacledAttrs.fromJson(Map<String, dynamic> json) => TentacledAttrs(
    name: json["name"],
    fontSize: json["fontSize"],
    fill: json["fill"],
    cornerRadius: json["cornerRadius"],
    width: json["width"],
    height: json["height"],
    draggable: json["draggable"],
    opacity: json["opacity"],
    x: json["x"]?.toDouble(),
    y: json["y"]?.toDouble(),
    text: json["text"],
    scaleY: json["scaleY"]?.toDouble(),
    scaleX: json["scaleX"]?.toDouble(),
    selfDefinedName: json["selfDefinedName"],
  );

  Map<String, dynamic> toJson() => {
    "name": name,
    "fontSize": fontSize,
    "fill": fill,
    "cornerRadius": cornerRadius,
    "width": width,
    "height": height,
    "draggable": draggable,
    "opacity": opacity,
    "x": x,
    "y": y,
    "text": text,
    "scaleY": scaleY,
    "scaleX": scaleX,
    "selfDefinedName": selfDefinedName,
  };
}

class TentacledChild {
  StickyAttrs? attrs;
  String? className;

  TentacledChild({this.attrs, this.className});

  factory TentacledChild.fromJson(Map<String, dynamic> json) => TentacledChild(
    attrs: json["attrs"] == null ? null : StickyAttrs.fromJson(json["attrs"]),
    className: json["className"],
  );

  Map<String, dynamic> toJson() => {
    "attrs": attrs?.toJson(),
    "className": className,
  };
}

class StickyAttrs {
  String? name;
  String? fill;
  List<int>? cornerRadius;
  int? width;
  int? height;
  double? x;
  double? y;
  String? text;
  bool? draggable;
  int? fontSize;
  double? scaleY;
  double? scaleX;

  StickyAttrs({
    this.name,
    this.fill,
    this.cornerRadius,
    this.width,
    this.height,
    this.x,
    this.y,
    this.text,
    this.draggable,
    this.fontSize,
    this.scaleY,
    this.scaleX,
  });

  factory StickyAttrs.fromJson(Map<String, dynamic> json) => StickyAttrs(
    name: json["name"],
    fill: json["fill"],
    cornerRadius:
        (json["cornerRadius"] == null || json["cornerRadius"] is int)
            ? []
            : List<int>.from(json["cornerRadius"]!.map((x) => x)),
    width: json["width"],
    height: json["height"],
    x: json["x"]?.toDouble(),
    y: json["y"]?.toDouble(),
    text: json["text"],
    draggable: json["draggable"],
    fontSize: json["fontSize"],
    scaleY: json["scaleY"]?.toDouble(),
    scaleX: json["scaleX"]?.toDouble(),
  );

  Map<String, dynamic> toJson() => {
    "name": name,
    "fill": fill,
    "cornerRadius":
        cornerRadius == null
            ? []
            : List<dynamic>.from(cornerRadius!.map((x) => x)),
    "width": width,
    "height": height,
    "x": x,
    "y": y,
    "text": text,
    "draggable": draggable,
    "fontSize": fontSize,
    "scaleY": scaleY,
    "scaleX": scaleX,
  };
}

class Unit {
  SingleAttrs? attrs;
  String? className;
  List<UnitChild>? children;

  Unit({this.attrs, this.className, this.children});

  factory Unit.fromJson(Map<String, dynamic> json) => Unit(
    attrs: json["attrs"] == null ? null : SingleAttrs.fromJson(json["attrs"]),
    className: json["className"],
    children:
        json["children"] == null
            ? []
            : List<UnitChild>.from(
              json["children"]!.map((x) => UnitChild.fromJson(x)),
            ),
  );

  Map<String, dynamic> toJson() => {
    "attrs": attrs?.toJson(),
    "className": className,
    "children":
        children == null
            ? []
            : List<dynamic>.from(children!.map((x) => x.toJson())),
  };
}

class UnitChild {
  PurpleAttrs? attrs;
  String? className;
  List<StickyChild>? children;

  UnitChild({this.attrs, this.className, this.children});

  factory UnitChild.fromJson(Map<String, dynamic> json) => UnitChild(
    attrs: json["attrs"] == null ? null : PurpleAttrs.fromJson(json["attrs"]),
    className: json["className"],
    children:
        json["children"] == null
            ? []
            : List<StickyChild>.from(
              json["children"]!.map((x) => StickyChild.fromJson(x)),
            ),
  );

  Map<String, dynamic> toJson() => {
    "attrs": attrs?.toJson(),
    "className": className,
    "children":
        children == null
            ? []
            : List<dynamic>.from(children!.map((x) => x.toJson())),
  };
}

class StickyChild {
  IndigoAttrs? attrs;
  String? className;
  List<IndigoChild>? children;

  StickyChild({this.attrs, this.className, this.children});

  factory StickyChild.fromJson(Map<String, dynamic> json) => StickyChild(
    attrs: json["attrs"] == null ? null : IndigoAttrs.fromJson(json["attrs"]),
    className: json["className"],
    children:
        json["children"] == null
            ? []
            : List<IndigoChild>.from(
              json["children"]!.map((x) => IndigoChild.fromJson(x)),
            ),
  );

  Map<String, dynamic> toJson() => {
    "attrs": attrs?.toJson(),
    "className": className,
    "children":
        children == null
            ? []
            : List<dynamic>.from(children!.map((x) => x.toJson())),
  };
}

class IndigoAttrs {
  String? name;
  double? x;
  double? y;
  bool? draggable;
  double? scaleY;
  double? scaleX;
  Device? device;
  FluffyDataPoint? dataPoint;
  List<int>? borderDash;
  String? anchorStroke;
  String? anchorFill;
  int? rotateAnchorOffset;
  List<int>? rotationSnaps;
  int? padding;
  String? borderStroke;
  List<String>? enabledAnchors;

  IndigoAttrs({
    this.name,
    this.x,
    this.y,
    this.draggable,
    this.scaleY,
    this.scaleX,
    this.device,
    this.dataPoint,
    this.borderDash,
    this.anchorStroke,
    this.anchorFill,
    this.rotateAnchorOffset,
    this.rotationSnaps,
    this.padding,
    this.borderStroke,
    this.enabledAnchors,
  });

  factory IndigoAttrs.fromJson(Map<String, dynamic> json) => IndigoAttrs(
    name: json["name"],
    x: json["x"]?.toDouble(),
    y: json["y"]?.toDouble(),
    draggable: json["draggable"],
    scaleY: json["scaleY"]?.toDouble(),
    scaleX: json["scaleX"]?.toDouble(),
    device: json["device"] == null ? null : Device.fromJson(json["device"]),
    dataPoint:
        json["dataPoint"] == null
            ? null
            : FluffyDataPoint.fromJson(json["dataPoint"]),
    borderDash:
        json["borderDash"] == null
            ? []
            : List<int>.from(json["borderDash"]!.map((x) => x)),
    anchorStroke: json["anchorStroke"],
    anchorFill: json["anchorFill"],
    rotateAnchorOffset: json["rotateAnchorOffset"],
    rotationSnaps:
        json["rotationSnaps"] == null
            ? []
            : List<int>.from(json["rotationSnaps"]!.map((x) => x)),
    padding: json["padding"],
    borderStroke: json["borderStroke"],
    enabledAnchors:
        json["enabledAnchors"] == null
            ? []
            : List<String>.from(json["enabledAnchors"]!.map((x) => x)),
  );

  Map<String, dynamic> toJson() => {
    "name": name,
    "x": x,
    "y": y,
    "draggable": draggable,
    "scaleY": scaleY,
    "scaleX": scaleX,
    "device": device?.toJson(),
    "dataPoint": dataPoint?.toJson(),
    "borderDash":
        borderDash == null ? [] : List<dynamic>.from(borderDash!.map((x) => x)),
    "anchorStroke": anchorStroke,
    "anchorFill": anchorFill,
    "rotateAnchorOffset": rotateAnchorOffset,
    "rotationSnaps":
        rotationSnaps == null
            ? []
            : List<dynamic>.from(rotationSnaps!.map((x) => x)),
    "padding": padding,
    "borderStroke": borderStroke,
    "enabledAnchors":
        enabledAnchors == null
            ? []
            : List<dynamic>.from(enabledAnchors!.map((x) => x)),
  };
}

class FluffyDataPoint {
  String? name;
  String? code;
  String? description;
  String? unit;
  String? statistics;
  int? dataWrite;
  int? dataLevel;
  List<dynamic>? range;
  bool? runningStatusFlag;
  int? statusFlag;
  dynamic rules;
  int? sort;
  int? startAddress;
  int? dataLength;
  int? valueType;
  int? analyticMethod;
  String? coefficient;
  dynamic dataPointLimit;
  bool? show;

  FluffyDataPoint({
    this.name,
    this.code,
    this.description,
    this.unit,
    this.statistics,
    this.dataWrite,
    this.dataLevel,
    this.range,
    this.runningStatusFlag,
    this.statusFlag,
    this.rules,
    this.sort,
    this.startAddress,
    this.dataLength,
    this.valueType,
    this.analyticMethod,
    this.coefficient,
    this.dataPointLimit,
    this.show,
  });

  factory FluffyDataPoint.fromJson(Map<String, dynamic> json) =>
      FluffyDataPoint(
        name: json["name"],
        code: json["code"],
        description: json["description"],
        unit: json["unit"],
        statistics: json["statistics"],
        dataWrite: json["dataWrite"],
        dataLevel: json["dataLevel"],
        range:
            json["range"] == null
                ? []
                : List<dynamic>.from(json["range"]!.map((x) => x)),
        runningStatusFlag: json["runningStatusFlag"],
        statusFlag: json["statusFlag"],
        rules: json["rules"],
        sort: json["sort"],
        startAddress: json["startAddress"],
        dataLength: json["dataLength"],
        valueType: json["valueType"],
        analyticMethod: json["analyticMethod"],
        coefficient: json["coefficient"],
        dataPointLimit: json["dataPointLimit"],
        show: json["show"],
      );

  Map<String, dynamic> toJson() => {
    "name": name,
    "code": code,
    "description": description,
    "unit": unit,
    "statistics": statistics,
    "dataWrite": dataWrite,
    "dataLevel": dataLevel,
    "range": range == null ? [] : List<dynamic>.from(range!.map((x) => x)),
    "runningStatusFlag": runningStatusFlag,
    "statusFlag": statusFlag,
    "rules": rules,
    "sort": sort,
    "startAddress": startAddress,
    "dataLength": dataLength,
    "valueType": valueType,
    "analyticMethod": analyticMethod,
    "coefficient": coefficient,
    "dataPointLimit": dataPointLimit,
    "show": show,
  };
}

class IndigoChild {
  IndecentAttrs? attrs;
  String? className;

  IndigoChild({this.attrs, this.className});

  factory IndigoChild.fromJson(Map<String, dynamic> json) => IndigoChild(
    attrs: json["attrs"] == null ? null : IndecentAttrs.fromJson(json["attrs"]),
    className: json["className"],
  );

  Map<String, dynamic> toJson() => {
    "attrs": attrs?.toJson(),
    "className": className,
  };
}

class IndecentAttrs {
  String? name;
  int? width;
  int? height;
  String? fill;
  int? cornerRadius;
  int? opacity;

  IndecentAttrs({
    this.name,
    this.width,
    this.height,
    this.fill,
    this.cornerRadius,
    this.opacity,
  });

  factory IndecentAttrs.fromJson(Map<String, dynamic> json) => IndecentAttrs(
    name: json["name"],
    width: json["width"],
    height: json["height"],
    fill: json["fill"],
    cornerRadius: json["cornerRadius"],
    opacity: json["opacity"],
  );

  Map<String, dynamic> toJson() => {
    "name": name,
    "width": width,
    "height": height,
    "fill": fill,
    "cornerRadius": cornerRadius,
    "opacity": opacity,
  };
}
